#include <stdio.h>

int main(void)
{
    int num[5][5];

    for (int i = 0; i < 5; i++)
    {
        printf("Enter student %d: ", i+1);
        for (int k = 0; k < 5; k++)
            scanf(" %d", &num[i][k]);
    }

    int sum[5], average[5], subject[5];

    for (int j = 0; j < 5; j++)
    {
        sum[j] = num[j][0] + num[j][1] + num[j][2] + num[j][3] + num[j][4];
        average[j] = sum[j] / 5;
        subject[j] = (num[0][j] + num[1][j] + num[2][j] + num[3][j] + num[4][j]) / 5;
    }

    int high[5], low[5];
    for (int k = 0; k < 5; k++)
    {
        high[k] = num[0][k];
        low[k] = num[0][k];

        for (int l = 1; l < 5; l++)
        {
            if (high[k] < num[l][k])
                high[k] = num[l][k];
            if (low[k] > num[l][k])
                low[k] = num[l][k];
        }
    }
    
    printf("\nHigh Score: ");
    for (int m = 0; m < 5; m++)
    {
        printf(" %d", high[m]);
    }
    
    printf("\nLow Score: ");
    for (int n = 0; n < 5; n++)
    {
        printf(" %d", low[n]);
    }
    
    return 0;
}